<template>
  <view>
    <u-empty :icon="icon" text="无法连接网络，请检查后重试" :marginTop="50"></u-empty>
    <view class="refresh">
      <text class="refresh_text" @click="refresh()">刷新</text>
    </view>
  </view>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      icon: require('@/static/none_network.png')
    }
  },
  methods: {
    refresh() {
      uni.getNetworkType({
        success: ({ networkType }) => {
          if(networkType != 'none') {
            uni.reLaunch({
              url: '/pages/index'
            })
          }
        }
      })
    }
  },
} 
</script>

<style scoped lang="scss">
.refresh {
  text-align: center;

  &_text {
    display: inline-block;
    margin: 20px auto;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba($color: $primary-theme-color, $alpha: .25);
    color: $primary-theme-color;
    font-weight: bold;
    letter-spacing: 2px;
  }
}
</style>